<template>
    <div>
        <van-nav-bar :title="$t('I18n使用')" fixed placeholder left-arrow @click-left="onClickLeft" />
        <div style="text-align: center;">
            <van-button type="primary" size="mini" @click.stop="changeLang">切换语言</van-button>
        </div>
        <van-calendar :title="$t('日历')" :poppable="false" :show-confirm="false" :style="{ height: '500px' }" />
    </div>
</template>

<script setup lang="ts">
import { useI18n } from "vue-i18n";
import { Calendar } from 'vant';
import { setLanguage } from '../lang'
const { locale } = useI18n();
const onClickLeft = () => history.back()
const changeLang = () => {
    if (locale.value == 'en-US') {
        setLanguage('zh-CN')
        locale.value = 'zh-CN'
    } else {
        setLanguage('en-US')
        locale.value = 'en-US'
    }

}
</script>

<style scoped lang="scss"></style>